package com.bwhx.eruler.dao.casdilly.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.bwhx.eruler.bean.Page;
import com.bwhx.eruler.bean.casdilly.BodyItem;
import com.bwhx.eruler.dao.casdilly.BodyItemDAO;
import com.bwhx.eruler.dao.impl.BaseDaoImpl;

@Repository
public class BodyItemDAOImpl extends BaseDaoImpl<BodyItem> implements BodyItemDAO{

	

 
	public BodyItemDAOImpl() {
		this.setNs("com.bwhx.eruler.mapper.casdilly.BodyItemMapper.");
	}
	
	@Override
	public List<BodyItem> list(Page p) {
		return getSqlSession().selectList(this.getNs() + "list", p);
	}

	@Override
	public Integer count(BodyItem bodyItem) {
		return getSqlSession().selectOne(this.getNs() + "count", bodyItem);
	}

	@Override
	public void del(BodyItem bodyItem) {
		getSqlSession().selectOne(this.getNs() + "del", bodyItem);
		
	}

	@Override
	public BodyItem findByName(String itemName) {
		
		return getSqlSession().selectOne(this.getNs() + "findByName", itemName);
	}

	@Override
	public List<BodyItem> listByIds(String[] idsArr) {
		return getSqlSession().selectList(this.getNs() + "findByIds", idsArr);
	}

	@Override
	public List<BodyItem> notInIds(String[] idsArr) {
		return getSqlSession().selectList(this.getNs() + "notInIds", idsArr);
	}

	@Override
	public BodyItem insertAndReturnID(BodyItem bodyItem) {
		  getSqlSession().insert(this.getNs() + "insert", bodyItem);
		return bodyItem;		
	}



	
	

}
